<?php
/**
 * CreateTime: 2023/11/16 15:53
 * User:LinQ
 */

namespace App\Http\Controllers\Login;

use App\Http\Controllers\Controller;
use App\Http\Requests\Login\LoginRequest;
use App\Http\Service\Login\LoginService;

class LoginController extends Controller
{
    public function getUserPuKey(){
        // 获取参数
        $request = request()->only('account','sign');
        // 参数校验
        (new LoginRequest())->scene('get_pu_key')->check($request);
        (new LoginService())->getUserPuKey($request);
    }

    public function login(){
        // 获取参数
        $request = request()->only('account','password','sign','pid');
        // 参数校验
        (new LoginRequest())->scene('login')->check($request);
        // 逻辑处理
        (new LoginService())->login($request);
    }
}
